Numerous electronic technologies such as digital computers, calculators, audio devices, video equipment, and telephone systems facilitate increased productivity and reduce costs in analyzing and communicating data in most areas of business, science, education and entertainment. Frequently, these activities involve computer programming and source code processing. Maintaining and updating the source code files can be complex and tedious.
Source code files are typically either dynamic or static and each has various advantages and disadvantages. Static type source code executes relatively fast during runtime, however is relatively difficult to maintain and update. Dynamic type source code is easy to maintain and update, but runs relatively slow As a practical matter, various pre-compile optimization is performed on the dynamic type source code to help it run faster. However, conventional approaches to pre-compile optimization introduce complexities that basically eliminate many of the advantages of dynamic type source code related to maintenance and updating.
One important feature of dynamic scripting language is that the code can be directly executed by the interpreter and no compilation process is required. This feature facilitates simplification of the hot patch processes. In effect, if the dynamic source code is not pre-compile optimized and there is a bug or programming defect in one source code file of an application's numerous files, the application maintainer can merely replace the original source code file corresponding to the bug with a patch or fixed source code file and reload it in the language interpreter (the other numerous source code files are untouched during the patching). However, when pre-compile optimization is used to overcome slow dynamic code, the pre-compile optimization can introduce challenges to traditional hot patch process attempts. In one conventional example, a first FILE1 defines a constant ABC=100 and a second file FILE2 uses the ABC constant in an operation K=ABC+25. Performing a conventional pre-compile optimization (e.g., constant propagation optimization) replaces ABC in FILE2 with 100 and the optimized file is K=125. However, if there is a change in FILE1 (e.g., defining ABC=200) and if the maintainer follows conventional hot patch process approaches (only replacing FILE1 and not touching FILE2) then the patch will not fix the problem because there is no corresponding appropriate consideration of the impact on FILE2.
To overcome the complexities and potential problems introduced by pre-compile optimization in dynamic code applications, conventional solutions typically use a whole application scope pre-compilation which replaces all the source code files in the application, and reloads all the source files (e.g. similar to static code approaches). However, these traditional approaches usually give rise to three problems that reduce or eliminate the maintenance and upload advantages otherwise associated with dynamic type source code. The first problem is an increase in the patching workload. Even though the patches are primarily directed to replacing and reloading the fixed files, the conventional approaches require replacing and reloading of all the files globally. The second problem is an increase in the pre-compilation complexity. The global scope of the pre-optimization often requires a long period (e.g., hours, days, etc.) for enterprise applications. In the original hot patch mode, no such step is required. The third problem is loss of the hot patch continuous run features. It's possible that the application maintainer stops the application to reload all files because some files belong to a particular type (e.g., base libraries, boot loaders, etc.) and cannot be replaced without stopping the application.
Dynamic scripting languages, such as JavaScript, Python, PHP, Lua, etc., are widely used in building large applications. Some examples include: Web front end applications (e.g., Google web based tools, like Map, Gmail, Calendar, Docs, etc.); Web back end applications (e.g., Facebook's application with PHP, etc.); gaming industry applications (e.g., Blizzard's World of Warcraft with Lua, etc.) and mobile applications (e.g., Apple's iOS applications with Object-C, etc.). Conventional approaches to maintaining and updating some files of a dynamic scripting language in large applications are typically time and resource intensive.